
package com.gm.commonlib.network.basenetwork.util;


import android.text.TextUtils;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

public class NetTimeUtils {
    public static String LONG_DATETIME_FORMAT_STRING = "yyyy-MM-dd HH:mm:ss";
    public static String SHORT_DATETIME_FORMAT_STRING = "yyyy-MM-dd";

    private static SimpleDateFormat b;

    static {
        b = new SimpleDateFormat(SHORT_DATETIME_FORMAT_STRING);
    }

    public NetTimeUtils() {
    }

    public static Date formatDateTime(String strDate, String formatter) {
        if (TextUtils.isEmpty(formatter)) {
            formatter = SHORT_DATETIME_FORMAT_STRING;
        }
        SimpleDateFormat formatter1 = new SimpleDateFormat(formatter);
        ParsePosition pos = new ParsePosition(0);
        return formatter1.parse(strDate, pos);
    }




}
